package cn.ljw.mybatis;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.sql.Connection;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * @author 一朝风月
 * @date 2024/9/21 20:20
 * @Code 面向注解面向卿，终无解释再无你
 * @description 封装Mybatis的配置信息, 包括数据库连接信息，mapper接口信息,事务管理等
 */

public class Configuration {
     protected Connection connection;
     protected Map<String,String> dataSource;//数据源
     protected Map<String,XNode>mapperElement=new ConcurrentHashMap<>();//安全点准没错

     public void setConnection(Connection connection) {
          this.connection = connection;
     }

     public void setDataSource(Map<String, String> dataSource) {
          this.dataSource = dataSource;
     }

     public void setMapperElement(Map<String, XNode> mapperElement) {
          this.mapperElement = mapperElement;
     }

     //     public <T> T getMapper(Class<T> type, SqlSession sqlSession) {
//          return this.mapperRegistry.getMapper(type, sqlSession);
//     }




}
